package com.example.xiaomi.service;

import com.example.xiaomi.entity.AdminInfo;
import com.example.xiaomi.entity.topic;
import com.example.xiaomi.entity.userinfo;
import com.example.xiaomi.mapper.UserMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServicempl implements UserService{
    @Autowired
    private  UserMapper mapper;
    @Override
    public PageInfo<userinfo> findUserPages(Integer pageNum, Integer pageSize, String user_name) {
        PageHelper.startPage(pageNum,pageSize);
        List<userinfo> lists = mapper.findAllUser();
        PageInfo<userinfo> pageInfo = new PageInfo<>(lists);
        return pageInfo;
    }
    @Override
    public List<userinfo> findAllUser() {
        List<userinfo> allUser= mapper.findAllUser();
        return allUser;
    }

    @Override
    public userinfo findUserBYID(Integer mid) {
        userinfo info = mapper.findUserBYID(mid);
        return info;
    }

}
